home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 March: Reference Library / Dev.CD Mar 96 RL / Dev.CD Mar 96 RL.toast / Technical Documentation / develop / develop Issue 25 / develop Issue 25 code / QD3D to QTVR / ArticleCode / Source / event.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-17  |  680 b   |  46 lines  |  [TEXT/MPCC]

  1. #include "QD3DtoQTVR.h"
  2. #include "extern.h"
  3. #include "event.h"
  4. #include "AEVT.h"
  5.  
  6. void EventLoop(void)
  7. {    
  8.     EventRecord        theEvent;
  9.     RgnHandle        theMouseRgn;
  10.  
  11.     theMouseRgn = NewRgn();
  12.  
  13.      while (! gQuit) {
  14.         if (WaitNextEvent(everyEvent, &theEvent, 0L, theMouseRgn))
  15.             DoEvent(&theEvent);
  16.     }
  17.     
  18.     DisposeRgn(theMouseRgn);
  19. }
  20.  
  21. void DoEvent(EventRecord *theEvent)
  22. {    
  23.     switch(theEvent->what) {
  24.         case nullEvent:
  25.             SendQuitApp();
  26.             break;
  27.         case mouseDown:
  28.             break;
  29.         case mouseUp:
  30.             break;
  31.         case keyDown:
  32.         case autoKey:
  33.             break;
  34.         case activateEvt:
  35.             break;
  36.         case updateEvt:
  37.             break;
  38.         case osEvt:
  39.             break;
  40.         case kHighLevelEvent:
  41.             DoHighLevelEvent(theEvent);
  42.             break;
  43.     }
  44. }
  45.  
  46.